package com.twu.biblioteca;

import java.util.List;

public class BibliotecaBookList implements BibliotecaCommand{
    private BibliotecaApp bibliotecaApp;
    public BibliotecaBookList(BibliotecaApp bibliotecaApp) {
        this.bibliotecaApp = bibliotecaApp;
    }


    @Override
    public void execute() {
        StringBuilder currentBookList = new StringBuilder();
        List<LibraryBook> bookList = bibliotecaApp.getBookList();

        for (LibraryBook book : bookList) {
            currentBookList.append(book.toString());
        }
        bibliotecaApp.outputMessage(currentBookList.toString());
    }
}

